<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
<head> 
<title>Scuola Media E. d'Arborea - Lamarmora </title> 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 
<meta name="description" content="Il sito della scuola secondaria superiore di Iglesias, in Sardegna" /> 
<meta name="keywords" content="scuola, iglesias, didattica, insegnamento, docenti" /> 
<link rel="stylesheet" href="andreas08.css" type="text/css" media="screen,projection" />
<link href="/css/themes/default.css" rel="stylesheet" type="text/css"/>
<link href="/css/themes/mac_os_x.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/js/prototype.js"></script> 
<script type="text/javascript" src="/js/scriptaculous.js"></script>
<script type="text/javascript" src="/js/page.js"></script>
<script type="text/javascript" src="/js/window.js"></script>
<script type="text/javascript" src="/js/window_effects.js"></script>
<script type="text/javascript">
classi = {};
materie = {};
<?php 
while(list($k, $v) = each($classi)){
?>
classi[<?php print $v[0] ?>] = '<?php print $v[1] ?>';
<?php 
}
while(list($k, $v) = each($materie)){
?>
materie[<?php print $v[0] ?>] = '<?php print $v[1] ?>';
<?php 
}
?>
subject = "";
clas = "";
hour = "";
day = "";
desc = "";
	
function upd_class(classe, id_classe){
	$('classe').innerHTML = classe;
	clas = id_classe;
}

function upd_subject(sub, id_sub){
	$('materia').innerHTML = sub;
	subject = id_sub;
}

function mod_ora(giorno, ora, classe, materia, descrizione){
	subject = materia;
	clas = classe;
	hour = ora;
	day = giorno;
	desc = descrizione;
	
	win = new Window({className: "mac_os_x",  width:400, height:null, zIndex: 100, resizable: true, title: "Dettaglio attivit&agrave;", showEffect:Effect.Appear, hideEffect: Effect.Fade, draggable:true, wiredDrag: true});
	win.getContent().update("<div style='font-weight: bold; font-size: 11px; text-align: center; margin-top: 20px' class='Titolo'>"+giorno+", "+ora+" ora</div><div style='text-align: center; font-weight: normal; font-size: 11px; padding: 10px; margin-top: 20px; padding-bottom: 35px'>	Classe: <span id='classe' style='color: red; font-weight: bold'>"+classi[classe]+"</span> - Materia: <span id='materia' style='color: red; font-weight: bold'>"+materie[materia]+"</span>	<table style='width: 65%; margin: auto'>		<tr>		<td colspan='2' style='text-align: center; font-weight: bold'>Modifica l'orario</td>		</tr>	<?php	if(count($classi) > count($materie))		$max = count($classi);	else		$max = count($materie);	for($i = 0; $i < $max; $i++){	?>	<tr style=''>		<td style='width: 20%; border-bottom: 1px dotted gray'>		<a href='#' onclick='upd_class(\"<?php print $classi[$i][1] ?>\", <?php print $classi[$i][0] ?>)' style='font-weight: normal'><?php print $classi[$i][1] ?></a>		</td>		<td style='width: 80%; border-bottom: 1px dotted gray; text-align: left'>		<a href='#' onclick='upd_subject(\"<?php print $materie[$i][1] ?>\", <?php print $materie[$i][0] ?>)' style='font-weight: normal'><?php print $materie[$i][1] ?></a>		</td>	</tr>	<?php	}	?><tr>		<td colspan='2' style='text-align: left; font-weight: normal; color: #467aa7'>Personalizza&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' style='width: 60%; border: 1px solid #467aa7; font-size: 11px; color: gray' maxlength='20' id='desc' value='' />		</td>	</tr>	</table>	<div style='width: 90%; text-align: right; padding-right: 20px; margin-top: 15px'>	<a href='#' onclick='upd_ora(0)' style='font-weight: normal' >Registra la modifica</a>&nbsp;|&nbsp;	<a href='#' onclick='upd_ora(1)' style='font-weight: normal' >Cancella l'ora</a>	</div></div>");     
	$('desc').value = desc;
	win.showCenter(true);	
}

function upd_ora(act){
	// act == 1 => delete
	desc = $('desc').value;
	var req = new Ajax.Request('/admin/adm_classes/upd_ora.php',
			  {
			    	method:'post',
			    	parameters: {act: act, getID: '1', giorno: day, ora: hour, materia: subject, classe: clas, desc: desc},
			    	onSuccess: function(transport){
			      		var response = transport.responseText || "no response text";
			      		//alert(response);
			      		var dati = response.split("|");
			    	},
			    	onFailure: function(){ alert("Si e' verificato un errore...") }
			  });
	var parent_row = "ora_"+day+"_"+hour;
	if(act != 1){
	  	$(parent_row).innerHTML = $('classe').innerHTML+" -- "+$('materia').innerHTML.substring(0, 19);
	  	if(desc != "")
	  		$(parent_row).innerHTML += " ("+desc+")";
	}
	else
		$(parent_row).innerHTML = " -- ";
	win.hide();
}

</script>
</head> 
 
<body> 
<div id="container" > 
 
<div id="header"> 
<h1>Scuola Media E. d'Arborea - Lamarmora</h1> 
<h2>area riservata ai docenti</h2> 
</div> 
<?php include "navigation.php" ?>
<div id="content"> 
    <h2 style="text-align: center">Orario personale del docente  [ <a href="pdf_personal_schedule.php">PDF</a> ]</h2> 
        <form method="post">
        <table width="90%" style="margin-right: auto; margin-left: auto; text-align: center; font-size: 11px" cellspacing="0">
        <tr>
            <td colspan="4" style="padding-bottom: 10px">&nbsp;&nbsp;&nbsp;</td>
        </tr>
        <tr style="font-weight: bold; height: 30px">
        	<td style="width: 7%; border-top: 1px solid; border-bottom: 2px solid; border-right: 1px solid; border-left: 1px solid; border-color: #c0c0c0">Ora</td>
        	<td style="width: 31%; border-top: 1px solid; border-bottom: 2px solid; border-right: 1px solid; border-color: #c0c0c0">Luned&igrave;</td>
        	<td style="width: 31%; border-top: 1px solid; border-bottom: 2px solid; border-right: 1px solid; border-color: #c0c0c0">Marted&igrave;</td>
        	<td style="width: 31%; border-top: 1px solid; border-bottom: 2px solid; border-right: 1px solid; border-color: #c0c0c0">Mercoled&igrave;</td>
        </tr>
        <?php 
        for($i = 0; $i < $ore; $i++){
        	reset($orario_doc);
        ?>
        <tr>
        	<td style="width: 7%; border-bottom: 1px solid; border-right: 1px solid; border-left: 1px solid; border-color: #c0c0c0"><?php print $inizio_ore[$i+1] ?></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid;; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Lun', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Lun'][$i + 1])) print ($orario_doc['Lun'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Lun'][$i + 1])) print ($orario_doc['Lun'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Lun'][$i + 1])) print ($orario_doc['Lun'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Lun_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Lun'][$i + 1])) {print ($orario_doc['Lun'][$i + 1]['cl'].$orario_doc['Lun'][$i + 1]['sezione']." -- ".substr($orario_doc['Lun'][$i + 1]['mat'], 0, 19)); if($orario_doc['Lun'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Lun'][$i + 1]['descrizione'].")");} else print "--"; ?></a></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid;; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Mar', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Mar'][$i + 1])) print ($orario_doc['Mar'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Mar'][$i + 1])) print ($orario_doc['Mar'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Mar'][$i + 1])) print ($orario_doc['Mar'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Mar_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Mar'][$i + 1])) {print ($orario_doc['Mar'][$i + 1]['cl'].$orario_doc['Mar'][$i + 1]['sezione']." -- ".substr($orario_doc['Mar'][$i + 1]['mat'], 0, 19)); if($orario_doc['Mar'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Mar'][$i + 1]['descrizione'].")");}else print "--"; ?></a></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid;; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Mer', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Mer'][$i + 1])) print ($orario_doc['Mer'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Mer'][$i + 1])) print ($orario_doc['Mer'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Mer'][$i + 1])) print ($orario_doc['Mer'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Mer_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Mer'][$i + 1])) {print ($orario_doc['Mer'][$i + 1]['cl'].$orario_doc['Mer'][$i + 1]['sezione']." -- ".substr($orario_doc['Mer'][$i + 1]['mat'], 0, 19)); if($orario_doc['Mer'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Mer'][$i + 1]['descrizione'].")");}else print "--"; ?></a></td>
        </tr>
        <?php 
        }
        ?>
        <tr>
            <td colspan="4">&nbsp;&nbsp;&nbsp;</td>
        </tr>
        <tr style="font-weight: bold; text-align: center; height: 30px">
        	<td style="width: 7%; border-bottom: 2px solid; border-right: 1px solid; border-left: 1px solid; border-top: 1px solid; border-color: #c0c0c0">Ora</td>
        	<td style="width: 31%; border-bottom: 2px solid; border-right: 1px solid; border-top: 1px solid; border-color: #c0c0c0">Gioved&igrave;</td>
        	<td style="width: 31%; border-bottom: 2px solid; border-right: 1px solid; border-top: 1px solid; border-color: #c0c0c0">Venerd&igrave;</td>
        	<td style="width: 31%; border-bottom: 2px solid; border-right: 1px solid; border-top: 1px solid; border-color: #c0c0c0">Sabato</td>
        </tr>
        <?php 
        for($i = 0; $i < $ore; $i++){
        	reset($orario_doc);
        ?>
        <tr>
        	<td style="width: 7%; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-color: #c0c0c0"><?php print $inizio_ore[$i+1] ?></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Gio', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Gio'][$i + 1])) print ($orario_doc['Gio'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Gio'][$i + 1])) print ($orario_doc['Gio'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Gio'][$i + 1])) print ($orario_doc['Gio'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Gio_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Gio'][$i + 1])) {print ($orario_doc['Gio'][$i + 1]['cl'].$orario_doc['Gio'][$i + 1]['sezione']." -- ".substr($orario_doc['Gio'][$i + 1]['mat'], 0, 19)); if($orario_doc['Gio'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Gio'][$i + 1]['descrizione'].")");}else print "--"; ?></a></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Ven', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Ven'][$i + 1])) print ($orario_doc['Ven'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Ven'][$i + 1])) print ($orario_doc['Ven'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Ven'][$i + 1])) print ($orario_doc['Ven'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Ven_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Ven'][$i + 1])) {print ($orario_doc['Ven'][$i + 1]['cl'].$orario_doc['Ven'][$i + 1]['sezione']." -- ".substr($orario_doc['Ven'][$i + 1]['mat'], 0, 19)); if($orario_doc['Ven'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Ven'][$i + 1]['descrizione'].")");}else print "--"; ?></a></td>
        	<td style="width: 31%; border-bottom: 1px solid; border-right: 1px solid; border-color: #c0c0c0"><a style="color: #303030;font-weight: normal" href="#" onclick="mod_ora('Sab', <?php print ($i + 1) ?>, <?php if(isset($orario_doc['Sab'][$i + 1])) print ($orario_doc['Sab'][$i + 1]['classe']); else print "0"; ?>, <?php if(isset($orario_doc['Sab'][$i + 1])) print ($orario_doc['Sab'][$i + 1]['materia']); else print "0"; ?>, '<?php if(isset($orario_doc['Sab'][$i + 1])) print ($orario_doc['Sab'][$i + 1]['descrizione']); else print ""; ?>')" id="ora_Sab_<?php print ($i + 1) ?>"><?php if(isset($orario_doc['Sab'][$i + 1])) {print ($orario_doc['Sab'][$i + 1]['cl'].$orario_doc['Sab'][$i + 1]['sezione']." -- ".substr($orario_doc['Sab'][$i + 1]['mat'], 0, 19)); if($orario_doc['Sab'][$i + 1]['descrizione'] != "") print(" (".$orario_doc['Sab'][$i + 1]['descrizione'].")");}else print "--"; ?></a></td>
        </tr>
        <?php 
        }
        ?>
        <tr>
                <td colspan="4">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;&nbsp;&nbsp;
                	<input type="hidden" name="mat" />
        			<input type="hidden" name="id_ora" />
                </td>
            </tr>
        </table>
        </form>

<div class="splitcontentleft"> 

<p>&nbsp;</p>
 
</div> 
 
 
</div> 
 
<div id="subcontent"> 
<div class="small box" style="text-align: center"> 
<a href="/get_file.php?dt=2&id=24&f=pof_2009_2010.pdf" style="color: red">Scarica il POF 2010-2012.</a> 
</div> 
 
<?php include "profile_menu.php" ?>

</div> 
 
<?php include "footer.php" ?> 
 
</div> 
</body> 
</html>